<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>双向绑定</title>
    <link href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>

    <div class="container mt15">
      <fieldset class="form-group" id="unameGroup">
        <label for="userName">名字：</label> <span id="title">{{ uname }}</span>
        <input type="text" class="form-control" id="userName" placeholder="请输入名字" v-model="uname">
      </fieldset>
    </div>

    <script src="//cdn.bootcss.com/vue/2.2.1/vue.js"></script>
    <script>
        new Vue({
          el: '#unameGroup',
          data: {
            uname: ''
          }
        });
    </script>
</body>
</html>
